﻿using System;

using Common.Base;

using GameCommon.Services;

namespace GameGraphics.Helper
{
    public static class UnitPositionHelper
    {
        public static Position GetPosition(Position startPosition, Position endPosition, float progress)
        {
            var x = (int)Math.Ceiling(Service.SplineEffectService.Linear(progress, startPosition.X, endPosition.X, 1));
            var y = (int)Math.Ceiling(Service.SplineEffectService.Linear(progress, startPosition.Y, endPosition.Y, 1));

            return new Position(x, y);
        }
    }
}